package com.dolphin.forest.weChat;

import cn.hutool.json.JSONObject;
import com.dolphin.forest.weChat.rep.ShowqrcodeRep;
import com.dolphin.forest.weChat.rep.WeChatForestResponse;
import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;

import java.util.Map;

/**
 * 描述:
 * ${DESCRIPTION}
 *
 * @author 林平
 * @create 2023-05-26 20:02
 * 个人博客地址：https://www.nonelonely.com
 */
@BaseRequest(baseURL = " https://api.weixin.qq.com")
public interface WeChatOffiaccountForest {

    @Get("/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}")
    JSONObject getAccessToken(String appid, String secret);

    @Post("/wxa/getwxacodeunlimit?access_token={0}")
    byte[] getShowqrcode(String accessToken, @JSONBody Map map);

    @Post("/sns/jscode2session?" +
            "appid=${0}&secret=${1}&js_code=${2}&grant_type=authorization_code")
    WeChatForestResponse wechatLogin(String appid, String secret, String code);
}
